package com.zeyi.chat.mapper;

import com.zeyi.chat.dto.Chat;import com.zeyi.chat.po.User;import org.apache.ibatis.annotations.Param;import java.util.List;

/**
 * @author zeyi
 */
public interface UserMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    //通过邮箱查找用户
    User findByEmail(@Param("email") String email);

    //获得聊天列表
    List<Chat> getChatList(@Param("userId") Integer userId);

    //获得所有好友id
    List<Integer> getFriendIds(@Param("userId") Integer userId);

    //添加好友
    int addFriend(@Param("userId") Integer userId, @Param("friendId") Integer friendId);

    //查询好友关系
    Object getRelation(@Param("userId") Integer userId, @Param("friendId") Integer friendId);

    //删除好友
    int deleteFriend(@Param("userId") Integer userId, @Param("friendId") Integer friendId);
}